const planePath =
  "path://M1705.06,1318.313v-89.254l-319.9-221.799l0.073-208.063c0.521-84.662-26.629-121.796-63.961-121.491c-37.332-0.305-64.482,36.829-63.961,121.491l0.073,208.063l-319.9,221.799v89.254l330.343-157.288l12.238,241.308l-134.449,92.931l0.531,42.034l175.125-42.917l175.125,42.917l0.531-42.034l-134.449-92.931l12.238-241.308L1705.06,1318.313z";
const points = [
  { value: [108.948024, 34.263161], itemStyle: { color: "#e79718" } }, //西安
  { value: [121.473701, 31.230416], itemStyle: { color: "#e79718" } }, //上海
  { value: [113.264385, 23.129112], itemStyle: { color: "#e79718" } }, //广州
  { value: [91.117733, 29.647496], itemStyle: { color: "#86e718" } }, //拉萨
  { value: [116.405285, 39.904989], itemStyle: { color: "#43d4fc" } }, //北京
  { value: [101.778008, 36.617144], itemStyle: { color: "#86e718" } }, //西宁
  { value: [119.1617, 36.709], itemStyle: { color: "#43d4fc" } }, //西宁
  { value: [126.5349, 45.8038], itemStyle: { color: "#43d4fc" } }, //西宁
];
option = {
  geo: {
    map: "china",
    roam: false, // 是否开启放大缩小/拖拽功能
    zoom: 1.2, // 缩放比列
    layoutCenter: ["50%", "50%"], // 地图中心点位置
    layoutSize: "85%",
    label: {
      show: true,
      color: "#fff",
    },
    itemStyle: {
      areaColor: "#414269",
      borderColor: "#5267f0",
      borderWidth: 0.5,
      shadowColor: "#444798",
      shadowBlur: 100,
    },
    emphasis: {
      //区域激活时的样式
      itemStyle: {
        areaColor: "#02102b",
      },
      label: {
        color: "#fff",
      },
    },
    // 设定地图的显示范围
  },
  series: [
    // 添加迁移线数据
    // 1
    {
      type: "lines",
      data: [
        // 配置多个点的数据

        {
          //上海
          coords: [
            [108.948024, 34.263161],
            [121.473701, 31.230416],
          ],
        },
        {
          //广州
          coords: [
            [108.948024, 34.263161],
            [113.264385, 23.129112],
          ],
        },
        {
          //拉萨
          coords: [
            [108.948024, 34.263161],
            [91.117733, 29.647496],
          ],
        },
        {
          //西宁
          coords: [
            [108.948024, 34.263161],
            [101.778008, 36.617144],
          ],
        },
        {
          //北京
          coords: [
            [108.948024, 34.263161],
            [116.405285, 39.904989],
          ],
        },
      ],
      effect: {
        show: true,
        period: 5, //箭头指向速度，值越小速度越快
        trailLength: 0, //特效尾迹长度[0,1]值越大，尾迹越长重
        // symbol: 'arrow', //箭头图标
        symbol: planePath,
        // 'image://',
        symbolSize: 15, //图标大小
      },
      lineStyle: {
        color: "#e79718",
        width: 1, //尾迹线条宽度
        opacity: 0.7, //尾迹线条透明度
        curveness: 0.3, //尾迹线条曲直度
      },
    },
    // 2
    {
      type: "lines",
      data: [
        {
          coords: [
            [101.778008, 36.617144],
            [113.264385, 23.129112],
          ],
        },
        {
          coords: [
            [101.778008, 36.617144],
            [121.473701, 31.230416],
          ],
        },
      ],
      effect: {
        show: true,
        period: 5, //箭头指向速度，值越小速度越快
        trailLength: 0, //特效尾迹长度[0,1]值越大，尾迹越长重
        // symbol: 'arrow', //箭头图标
        symbol: planePath,
        // 'image://',
        symbolSize: 15, //图标大小
      },
      lineStyle: {
        color: "#86e718",
        width: 1, //尾迹线条宽度
        opacity: 0.7, //尾迹线条透明度
        curveness: 0.3, //尾迹线条曲直度
      },
    },
    // 3
    {
      type: "lines",
      data: [
        {
          coords: [
            [91.117733, 29.647496],
            [116.405285, 39.904989],
          ],
        },
        {
          coords: [
            [91.117733, 29.647496],
            [119.1617, 36.709],
          ],
        },
        {
          coords: [
            [91.117733, 29.647496],
            [126.5349, 45.8038],
          ],
        },
      ],
      effect: {
        show: true,
        period: 5, //箭头指向速度，值越小速度越快
        trailLength: 0, //特效尾迹长度[0,1]值越大，尾迹越长重
        // symbol: 'arrow', //箭头图标
        symbol: planePath,
        // 'image://',
        symbolSize: 15, //图标大小
      },
      lineStyle: {
        color: "#43d4fc",
        width: 1, //尾迹线条宽度
        opacity: 0.7, //尾迹线条透明度
        curveness: 0.3, //尾迹线条曲直度
      },
    },
    // 带有涟漪特效动画的散点（气泡）图
    {
      type: "effectScatter",
      coordinateSystem: "geo",
      showEffectOn: "render",
      zlevel: 1,
      rippleEffect: {
        number: 3, // 波纹的数量。
        period: 9, // 动画的周期，秒数。
        scale: 16, // 动画中波纹的最大缩放比例。
        brushType: "fill", // 波纹的绘制方式，可选 'stroke' 和 'fill'。
      },
      symbolSize: 2,
      data: points,
    },
  ],
};
var column2Map = document.querySelector(".column2_map .echart");
var column2MapMyChart = echarts.init(column2Map);

option && column2MapMyChart.setOption(option);
